package com.pengxun.manager.enums;

/**
 * @author zhongzhu
 * @Title: code-manager
 * @Package com.szeastroc.manager.enums
 * @Description:
 * @date 2018/10/1516:23
 */
public enum PackageBIllEnum {

    DISABLE(0,"未开始"),

    EXECUTING(1,"进行中"),

    FINISH(2,"已完成"),

    FAIL(-1,"失败"),
    ;

    private Integer type;

    private String desc;

    PackageBIllEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static PackageBIllEnum getEnumByType(Integer type){
        PackageBIllEnum[] enums = PackageBIllEnum.values();
        for(PackageBIllEnum statusEnum:enums){
            if(statusEnum.getType() == type){
                return statusEnum;
            }
        }
        return null;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
